/**
 * Created by Administrator on 2017/12/4 0004.
 */

$(function(){
    var ls=window.location.href;
    ls=ls.split('/');
    function browserRedirect() {

        var sUserAgent= navigator.userAgent.toLowerCase();

        var bIsIpad= sUserAgent.match(/ipad/i) == "ipad";

        var bIsIphoneOs= sUserAgent.match(/iphone os/i) == "iphone os";

        var bIsMidp= sUserAgent.match(/midp/i) == "midp";

        var bIsUc7= sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";

        var bIsUc= sUserAgent.match(/ucweb/i) == "ucweb";

        var bIsAndroid= sUserAgent.match(/android/i) == "android";

        var bIsCE= sUserAgent.match(/windows ce/i) == "windows ce";

        var bIsWM= sUserAgent.match(/windows mobile/i) == "windows mobile";

        if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {



        } else {

            window.location= '../../html/'+ls[ls.length-1];

        }

    }

    browserRedirect();
    $('.content').after('<nav class="navbar navbar-inverse footnav cyo">' +
        '<div class="container-fuild">' +
        '<div class="row">' +
        '<div class="col-lg-12 col-xs-12 col-sm-12 col-md-12 text-center">' +
        '<div class="footdiv akon1">' +
        '<div class="peyog"><div class="text-left" style="display: inline-block;width: 50%">' +
        '<img src="../img/jmyp-wx1.png" class="wxclick" width="100%" alt="...">' +
        '<img src="../img/jmyp-qq.png" width="100%" alt="..."/>' +
        '<img src="../img/jmyp-xl.png" width="100%" alt="..."/>' +
        '</div>' +
        '<a style="display: inline-block" href="contactUs.html">' +
        '<span class="zxbtn">我要咨询 ></span>'+
        '</a>'+
        '</div><div>' +
        '<img src="../img/wxerw.png" class="wxclick2" style="    width: 60px;position: absolute;left: 5%;top: 25px; display: none;z-index: 1;" alt=""></div>'+
        '</div>' +
        '</div>' +
        '<div class="col-lg-12 col-xs-12 col-sm-12 col-md-12">' +
        '<div class="footdiv2">' +
        '<p class="">总部地址:湖南省长沙市高新开发区文轩路27号麓谷企业广场</p>' +
        '<p class=" rightp">电话:0731-85159162</p>' +
        '<p class=" rightp">咨询邮箱:282850486@qq.com</p>' +
        '<p class="footsr">2005-2016 湖南聚媒优品有限公司 版权所有 湘ICP备17020348号-1</p>' +
        '</div>' +
        '</div>' +
        '</div>' +
        '</div></nav>');
        $('.content').before('<nav class="navbar navbar-inverse navbar-fixed-top">' +
            '<div class="container-fuild">' +
            '<div class="navbar-header" style="height:50px;padding-top: 5px;position: relative;">' +
            '<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-7" aria-expanded="false" style="margin-top: 0px;float: none;position: absolute;right:0px;">' +
            '<span class="sr-only">Toggle navigation</span>' +
            '<img src="../img/header-icon.png" width="50%" alt=""/>' +
            '</button>' +
            '<a class="navbar-brand" href="index.html" style="float:none;text-align: center;display: block;"><img src="../img/logo.png"  alt="" style="display: inline-block;width: 35%;"/></a>' +
            '</div> ' +
            '<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-7" style="max-height: 1000px;">' +
            '<ul class="nav navbar-nav topmenu">' +
            '<li><a href="index.html">首页</a></li>' +
            '<li><a href="about.html">关于</a></li>' +
            '<li><a href="service.html">服务</a></li>' +
            '<li><a href="caseStudy.html">案例</a></li>' +
            '<li><a href="personnel.html">人才</a></li>' +
            '<li><a href="contactUs.html">联系</a></li>' +
            '</ul></div>' +
            '</div></nav>');
    $('.wxclick').on('click',function () {
        $('.wxclick2').fadeToggle();
    })
    if(ls[ls.length-1]=='index.html'){
        $('.topmenu li:nth-child(1)').addClass('active');
    }
    if(ls[ls.length-1]=='about.html'){
        $('.topmenu li:nth-child(2)').addClass('active');
    }
    if(ls[ls.length-1]=='team.html'){
        $('.topmenu li:nth-child(3)').addClass('active');
    }
    if(ls[ls.length-1]=='history.html'){
        $('.topmenu li:nth-child(4)').addClass('active');
    }
    if(ls[ls.length-1]=='personnel.html'){
        $('.topmenu li:nth-child(5)').addClass('active');
    }
    if(ls[ls.length-1]=='news.html'){
        $('.topmenu li:nth-child(6)').addClass('active');
    }
    if(ls[ls.length-1]=='contactUs.html'){
        $('.topmenu li:nth-child(7)').addClass('active');
    }
})
